home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
ppascal.zip
/
SPIRAL3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-04-24
|
1KB
|
33 lines
program spiral3;
{ makes a really neeto spiral of a random color }
uses
Crt, Graph;
const
width = 1; { width of the line: 1 = narrow, 3 = wide }
finalDiam = 2000; { the final diameter of the spiral }
betweenWidth = 2; { distance between the lines }
startingradius = 1; { initial spiral radius }
var
graphDriver,
ErrorCode,
GraphMode : integer;
radius : integer;
ch : char;
begin
graphdriver := detect;
InitGraph( Graphdriver, GraphMode, 'c:\utils\tp');
ErrorCode := Graphresult;
if errorcode <> grOk then halt(1);
randomize;
setcolor ( random (getmaxColor - 1 ) + 1 ); {sets color of spiral }
setlinestyle( 0, 0, width);
radius := startingradius;
repeat
circle ( 320,240,radius);
inc ( radius, betweenwidth );
until ( radius > finaldiam ) or ( keypressed);
if keypressed then ch := readkey;
ch := readkey;
closegraph;
end.